@extends('home.enterprises.layout')
@section('content')
<div class="ip_company new_position">
	<h1 style="font-weight: bolder; color: #114374; font-size:18px;margin-left:10px">  请填写公司信息，并完成企业认证</h1>
	<br>
	@if(session('info'))
	{{	session('info') }}
	@endif
	<form enctype="multipart/form-data" method="post" action="/home/enterprise/changes/{{ $id }}" id="editCompanyInfo_forms" onsubmit='return check();' name="editCompanyInfo_form">
		{{ csrf_field() }}
		
		<div class="selectPositionWrap" id="selectPosition-input1" style="display: none; left: 80px; position: absolute; top: 55px; z-index: 9000;">
			<div class="header">
				<h3 class="title">主要行业：<span>最多添加<em class="count">1</em>个</span></h3><a class="closeIco" href="javascript:void(0)"></a>
			</div>
			<div class="content">
				@foreach($industryData as $v)
				<span class="checkable"><input name="position" 
				@if(($v -> id == session('master['.$id.']') -> firstIndustry) && !empty(session('master['.$id.']') -> firstIndustry))
					checked = 'true'
				@endif
				id="input1-selectPositionSpan-{{ $v -> id }}" value="{{ $v -> id }}" type="checkbox"><label for="input1-selectPositionSpan-{{ $v -> id }}" class="labelPosition">{{ $v -> name }}</label></span>
				@endforeach
				
				<div class="selectCity-clearfix"></div>
			</div>
			
			<div class="footer">
				<a class="confirm" href="javascript:void(0)">确定</a>
				<a class="cancle" href="javascript:void(0)">取消</a>
			</div>
		</div>
		<table width="100%" cellspacing="0" cellpadding="0" >
			<tbody>
			<tr>
				<th width="100" class="post_must">公司名称</th>
				<td>
					<input type="text" value="{{ session('master['.$id.']') -> compname }}" name="corpname" id="corpname">
				</td>
			</tr>
			<tr>
				<th class="post_must">主要行业</th>
				<td>
					<div class="imitationSel">
						<input style='width:29%;float:left;' class="form-control input-sm" type="button" readonly="readonly" id="input1" class="imitationSelinput" name="input1" placeholder='请选择所属行业' 
						@if(!empty(session('master['.$id.']') -> firstIndustryN))
						value="{{ session('master['.$id.']') -> firstIndustryN }}"
						@else
						value="请选择所属行业"
						@endif
						>
						<span class="arr"></span>
						<input type="hidden" id="firstIndustry" name="firstIndustry" value="input1-selectPositionSpan-{{ session('master['.$id.']') -> firstIndustry }}">
					</div>
					</td>
			</tr>
			<tr>
				<th>次要行业</th>
				<td>
					<table cellspacing="0" cellpadding="0" border="0" style="width: 530px; float: left;" id="hangye">
						<tbody><tr>
							<td valign="top" style="width: 245px;" class="o3class">
							<select id="industry" size="5" multiple="multiple" style="width: 245px; height: 77px; *+ height: 88px;">
							@foreach($industryData as $v)
							<option value="{{ $v -> id }}">{{ $v -> name }}</option>
							@endforeach
							<option value="160400">计算机软件</option>
							<option value="160000">IT服务(系统/数据/维护)</option><option value="160500">电子技术/半导体/集成电路</option><option value="160200">计算机硬件</option><option value="300100">通信/电信/网络设备</option><option value="160100">通信/电信运营、增值服务</option><option value="160600">网络游戏</option><option value="180000">基金/证券/期货/投资</option><option value="180100">保险</option><option value="300500">银行</option><option value="300900">信托/担保/拍卖/典当</option><option value="140000">房地产/建筑/建材/工程</option><option value="140100">家居/室内设计/装饰装潢</option><option value="140200">物业管理/商业中心</option><option value="200300">专业服务/咨询(财会/法律/人力资源等)</option><option value="200302">广告/会展/公关</option><option value="201400">中介服务</option><option value="201300">检验/检测/认证</option><option value="300300">外包服务</option><option value="120400">快速消费品（食品/饮料/烟酒/日化）</option><option value="120200">耐用消费品（服饰/纺织/皮革/家具/家电）</option><option value="170500">贸易/进出口</option><option value="170000">零售/批发</option><option value="300700">租赁服务</option><option value="201100">教育/培训/院校</option><option value="120800">礼品/玩具/工艺美术/收藏品/奢侈品</option><option value="121000">汽车/摩托车</option><option value="129900">大型设备/机电设备/重工业</option><option value="121100">加工制造（原料加工/模具）</option><option value="121200">仪器仪表及工业自动化</option><option value="210600">印刷/包装/造纸</option><option value="120700">办公用品及设备</option><option value="121300">医药/生物工程</option><option value="121500">医疗设备/器械</option><option value="300000">航空/航天研究与制造</option><option value="150000">交通/运输</option><option value="301100">物流/仓储</option><option value="121400">医疗/护理/美容/保健/卫生服务</option><option value="200600">酒店/餐饮</option><option value="200800">旅游/度假</option><option value="210300">媒体/出版/影视/文化传播</option><option value="200700">娱乐/体育/休闲</option><option value="130000">能源/矿产/采掘/冶炼</option><option value="120500">石油/石化/化工</option><option value="130100">电气/电力/水利</option><option value="201200">环保</option><option value="200100">政府/公共事业/非盈利机构</option><option value="120600">学术/科研</option><option value="100000">农/林/牧/渔</option><option value="100100">跨领域经营</option><option value="990000">其他</option>
							</select>
							</td>
							<td align="center" style="padding: 0px 5px 0px 5px;">
								<!-- <input type="button" onclick="javascript:AddItem('editCompanyInfo_form','industry','industrylist',3,1);" class="ip_add"><br>
								<input type="button" onclick="javascript:DeleteItem('editCompanyInfo_form','industrylist');" class="ip_shanchu">
							 -->
								<input type="button" class="ip_add"><br>
								<input type="button" class="ip_shanchu"><br>
								
							</td>
							<td style="width: 245px" class="o3class">
							<select id="industrylist" name="industrylist[]" size="5" multiple="multiple" style="width: 245px; height: 77px;  height: 88px;">
									@if(count(session('master['.$id.']') -> industrylist) &&  !empty(session('master['.$id.']') -> industrylist))
										@foreach(session('master['.$id.']') -> industrylist as $k => $v )
											<option value="{{ $v }}">{{ $k }}</option>
										@endforeach
									@endif
							</select>
							</td>
						</tr>
					</tbody></table></td>
			</tr>
			
			<script>
			window.onload=function()
			{
				// alert($);
				var i=-1;
				var bk = true;
				$('input[class^=ip][type=button]').eq(0).click(function(){
					// console.log($('#firstIndustry'));
					var select = null;
					if($('#industry').get(0).selectedIndex == -1)
					{
						$('#industry').get(0).selectedIndex=0;
						$('#industry').children().eq(0).attr('selected','true');
						// console.log($('#industry').children().eq(0).val());
					}else{
						if($('#industrylist').children().length == 3)
						{
							alert('只能添加三个');
							return false;
						}
						// console.log($('#industry').children().eq(0).val());
						// console.log($('#firstIndustry').val());
						if($('#firstIndustry').val())
						{
							if($('#industry').children().eq($('#industry').get(0).selectedIndex).val().indexOf($('#firstIndustry').val()) >= 0)
							{
								alert('此项已在主行业选中');
								$('#industry').get(0).selectedIndex++;
								$('#industry').children().eq($('#industry').get(0).selectedIndex).attr('selected','true');
								return false;
							}
						}
						
						$('#industrylist').children().each(function(i,v){
							// console.log($(v).val());
							// console.log($('#firstIndustry').val());
							if($(v).val().indexOf($('#industry').children().eq($('#industry').get(0).selectedIndex).val()) >=0)
							{
								
								$('#industry').get(0).selectedIndex++;
								$('#industry').children().eq($('#industry').get(0).selectedIndex).attr('selected','true');
								bk = false;
								return false;
							}
						});
						// 
						if(!bk)
						{
							bk=true;
							alert('此项已经存在');
							return false;
						}
						select = $('#industry').children().eq($('#industry').get(0).selectedIndex).attr('selected','true').clone(true);
						select.removeAttr('selected');
						$('#industrylist').append(select);
						$('#industry').get(0).selectedIndex++;

						
					}
					// $('#industry').children().each(function(c,v){
					// 	$(v).removeAttr('selected','false')
					// });
					
					// console.log(select);
					
					
				});
				var i = -1;
				$('input[class^=ip][type=button]').eq(1).click(function(){
					// console.log($('#industrylist').get(0).selectedIndex);
					i = $('#industrylist').get(0).selectedIndex;
					// alert($(this).attr('class'));
					if(i == -1)
					{	
						$('#industrylist').get(0).selectedIndex=0;
						i=0;
						$('#industrylist').children().eq(0).attr('selected','true');
					}else{

						$('#industrylist').children().eq(i).remove();
						if($('#industrylist').children().length==i) 
						{
							i = 0;
						}
						// console.log($('#industrylist').children());
						$('#industrylist').get(0).selectedIndex = i;
						
						$('#industrylist').children().eq(i).attr('selected','true');

						
						
					}
				});

				$('#input1').click(function(){
					// alert($(this).val());
					var thi = $(this);
					var div = $('<div></div>');
					var div1 = div.clone();
					var divT = $(this).offset().top;
					var divL = $(this).offset().left + $(this).width();
					var id = null;
					var idh = null;
					var content = null;
					// div背景
					div.css({
						width:$(window).width()+'px',
						height:$(document).height()+'px',
						background:'rgba(179,179,179,0.4)',
						position:'absolute',
						top:0,
						left:0,
						display:'block',
						zIndex:'1000'
					});
					div.attr('id','zzc');
					
					// console.log(div);
					// div.append(div1);
					$('body').append(div);
					$('#selectPosition-input1').css({
						display:'block',
					});
					function clse()
					{
						$(div).hide();
						$('#selectPosition-input1').hide();
					}
					// clse();
					// console.log($('#selectPosition-input1 input'));
					$('#selectPosition-input1 input').each(function(i,v){
						$(v).click(function(){
							id = $(this).attr('id');
							$('#selectPosition-input1 input:not(#'+id+')').removeAttr('checked');
							content = $('#'+id).next().html();
							idh = $('#'+id).val();
							// console.log($('#'+id).next().html());
							// console.log($('#'+id).val());
							// $('#selectPosition-input1 input:checked');
							// $(this).attr('checked','true');
						});
					});
					$('#selectPosition-input1').find('.closeIco').click(clse);
					$('#selectPosition-input1').find('.cancle').click(clse);
					var stat = false;
					$('#selectPosition-input1').find('.confirm').click(function(){
						// alert(id);
						// alert($(this).attr('class'));
						// $('#selectPosition-input1 input:checked').removeAttr('checked')
						// console.log($('#selectPosition-input1 input:checked'));
						// console.log($('#selectPosition-input1 input:checked').length);
						// console.log($('#'+id).next().html());
						// console.log($('#'+id).val());
						// return false;
						// console.log(idh);
						$('#industrylist').children().each(function(i,v){
							// console.log($(v).val());
							if($(v).val().indexOf(idh) >= 0)
							{
								stat = true;
								return false;
							}
						});

						if(stat)
						{
							alert('已存在次要行业');
							stat = false;
							return false;
						}
						thi.val(content);
						$('#firstIndustry').val(idh);
						// console.log();
						clse();
					});
					// div.append($('#selectPosition-input1'));
					// $('#industry').clone(true).children().each(function(){

					// });
				});


				// start
				function mobanc()
				{

					// alert($(this).val());
					$(this).unbind('click');
					var thi = $(this);
					var div = $('<div></div>');
					var divT = $(this).offset().top;
					var divL = $(this).offset().left + $(this).width();
					var id = null;
					var idh = null;
					var content = null;
					// div背景
					div.css({
						width:$(window).width()+'px',
						height:$(document).height()+'px',
						background:'rgba(179,179,179,0.4)',
						position:'absolute',
						top:0,
						left:0,
						display:'block',
						zIndex:'1000'
					});
					div.attr('id','zzc');
					
					// console.log(div);
					// div.append(div1);
					$('body').append(div);
					$('#popupDiv_contactFromComp').css({
						visibility:'visible',
					});
					function clse()
					{
						$(div).css({
							visibility:'hidden',
						});
						$('#popupDiv_contactFromComp').css({
							visibility:'hidden',
						});
						thi.click(mobanc);
					}
					$('#popupDiv_contactFromComp').find('.cancle').click(clse);
					$('#popupDiv_contactFromComp').find('.confirm').click(function(){
						// var span = $('#popupDiv_contactFromComp').find('input,span');
						var str = '';
						$('#popupDiv_contactFromComp').find('input,span').each(function(i,v){
							
							if(i%3==2 && this.value)
							{
								// console.log(this.value);
								if(this.value.lastIndexOf('--')>=0)
								{
									str = str + this.value.substr(this.value.lastIndexOf('--')+2)+'<br>';
									
								}else
								{
									str +=this.value + '<br>';
								}
								
							}else if(i%3==1)
							{
								str += $(v).html();
							}
							
						});
						// console.log(str);
						lxfs.setContent(str, true);
						clse();
					});
					
				
				}
				$('#moban').click(mobanc);
				// $.ajaxSetup({
		  //           headers: {
		  //               'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		  //           }
		  //       });
				// $('#rzzl').click(function(){
				// 	// alert(111);
				// 	$.ajax({
				// 		url:'{{ url("/home/enterprise/img") }}',
				// 		data:{img:'{{ session("master[".$id."]") -> licenseImage }}'},
				// 		type:'post',
				// 		success:function(data)
				// 		{
				// 			// alert(data);
				// 		},
				// 		dataType:'json'
				// 	});
				// 	return false;
				// });
				
			}
			</script>
			<tr>
				<th class="post_must">公司性质</th>
				<td><label> <select id="corptype" name="corptype">
							<option	value="0">请选择</option>
							
							<option
							@if(session('master['.$id.']') -> corptype == 1) 
								selected='true'
							@endif
							value="1">国企</option>
							<option
							@if(session('master['.$id.']') -> corptype == 2) 
								selected='true'
							@endif
							value="2">外商独资</option>
							<option
							@if(session('master['.$id.']') -> corptype == 3) 
								selected='true'
							@endif
							value="3">代表处</option>
							<option
							@if(session('master['.$id.']') -> corptype == 4) 
								selected='true'
							@endif
							value="4">合资</option>
							<option
							@if(session('master['.$id.']') -> corptype == 5) 
								selected='true'
							@endif
							value="5">民营</option>
							<option
							@if(session('master['.$id.']') -> corptype == 7) 
								selected='true'
							@endif
							value="7">股份制企业</option>
							<option
							@if(session('master['.$id.']') -> corptype == 8) 
								selected='true'
							@endif
							value="8">上市公司</option>
							<option
							@if(session('master['.$id.']') -> corptype == 6) 
								selected='true'
							@endif
							value="6">国家机关</option>
							<option
							@if(session('master['.$id.']') -> corptype == 9) 
								selected='true'
							@endif
							value="9">事业单位</option>
							<option
							@if(session('master['.$id.']') -> corptype == 10) 
								selected='true'
							@endif
							value="10">其它</option>
					</select> </label>
				</td>
			</tr>
			<tr>
				<th class="post_must">公司规模</th>
				<td><label> <select id="corpsize" name="corpsize">
							<option value="7">请选择</option>
							<option
							@if(session('master['.$id.']') -> corpsize == 1) 
								selected='true'
							@endif
							value="1">20人以下</option>
							<option
							@if(session('master['.$id.']') -> corpsize == 2) 
								selected='true'
							@endif
							value="2">20-99人</option>
							<option
							@if(session('master['.$id.']') -> corpsize == 3) 
								selected='true'
							@endif
							value="3">100-499人</option>
							<option
							@if(session('master['.$id.']') -> corpsize == 4) 
								selected='true'
							@endif
							value="4">500-999人</option>
							<option
							@if(session('master['.$id.']') -> corpsize == 5) 
								selected='true'
							@endif
							value="5">1000-9999人</option>
							<option
							@if(session('master['.$id.']') -> corpsize == 10) 
								selected='true'
							@endif
							value="6">10000人以上</option>
					</select> </label>
				</td>
			</tr>
			<tr>
				<th class="post_must">所在地</th>
				<td>
					<table width="100%" cellspacing="0" cellpadding="0">
						<tbody><tr>
							<td style='width:300px;'><!-- <input type="hidden" name="locationId" id="locationId"
								value="" /> <input type="text" name="locationName"
								class="city" id="locationName" value="添加城市"
								readonly="readonly" onchange="chargeLocation(this.value);" />
								&nbsp;&nbsp; <input type="text" name="location" class="city"
								id="location" value="添加地理位置" readonly="readonly"
								style="display: none;"
								onclick="fnMarkMap(this.form.locationId.value, this.form.locationName.value, this.form.parentPosLat.value, this.form.parentPosLon.value)" /> -->
								<!-- <div class="imitationSel">
									<input type="button" id="button_SF_1_1_6F" class="imitationSelinput" value="请选择城市">
									<input type="hidden" value="" id="SF_1_1_6" name="SF_1_1_6">
									<input type="hidden" value="" id="SF_1_1_6_cq" name="SF_1_1_6_cq">
                                    <span class="arr"></span>
                       			 </div> -->
                       			 <div class="form-group">
							    <input  id='cw' name='cw' style='width:45%;' readonly="readonly" class="form-control input-sm" type="text" placeholder="请选择城市" value='{{ session("master[".$id."]") -> cityN }}'>
							    <input id='citywork' name='citywork' type="hidden" value="{{ 'cityF_aItem_'.session('master['.$id.']') -> city }}">
							</div>
							<div id="cityF_popupDiv" class="searchPopupDiv" style="width: 390px; z-index: 9030; left: 105px; top: 400px; visibility: hidden;">
								<table class="searchItemTab" style="border:2px solid #64B5E5" cellspacing="0" cellpadding="0" border="0">
									<tbody>
										<tr>
											<td colspan="3" class="title" id="cityF_mMove" style="padding-top:5px;background:#64B5E5;cursor:auto;"><div class="left">工作地点：</div><div class="right">[ <span onclick="" class="substitute4a" title="">关闭</span> ]</div>
											</td>
										</tr>
										<tr>
											<td colspan="3" class="content" style="border:0;">
											<div></div>
											<div id="cityF_dDiv" style="display: none;"></div>
											<div id="cityF_dDiv_h">
												<div class="hotcitysTitle">
													<span class="substitute4a" style="margin-right:18px" onclick=""><img src="/home/img/blank.gif" class="iconopen" id="cityF_hConIcon"></span>&nbsp;&nbsp;主要城市
												</div>
												<div id="cityF_hCon" class="hotcitysCon" style="display:;">
													<table class="hotcitysItemTab" cellspacing="0" cellpadding="0" border="0">
													<tbody>
														<tr>
														@foreach($mainData as $k => $v)
															<td width="20%">
																<span id="cityF_aItem_{{ $v -> id }}" onclick="" class="substitute4a itemSpan"><div class="cityItemPadding">{{ $v -> name }}</div></span>
															
															</td>
															@if(($k+1) % 5 == 0)
															</tr>
															<tr>
															@endif
														@endforeach
														</tr>
													</tbody>
													</table>
												</div>
											</div>
											<div id="cityF_dDiv_p"><div class="provincesTitle">
												<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td><span onclick="" class="substitute4a"><img src="/home/img/blank.gif" class="iconopen" id="cityF_pConIcon"></span>&nbsp;&nbsp;</td><td id='procity'>省市</td></tr></tbody>
												</table></div>
												<div id="cityF_pCon" class="provincesCon" style="display:;">
												<table class="provincesItemTab" cellspacing="0" cellpadding="0" border="0"><tbody>
												<tr>
												@foreach($pidData as $k => $v)
													<td width="20%" >
													<span id="cityF_aItem_{{ $v -> id }}" onclick=""  class=" substitute4a itemSpan"><div pid='{{ $v -> id }}' class="cityItemPadding">{{ $v -> name }}</div></span>
													
														@if(count($idData[$k]))
														<table style="display:none; background: #fff;width:386px" class="provincesItemTab" cellspacing="0" cellpadding="0" border="0">
														<tbody>
														<tr>
														@foreach($idData[$k] as $ke => $va)
															<td width="20%">
															<span id="cityF_aItem_{{ $va -> id }}" onclick="" class=" substitute4a itemSpan"><div class="cityItemPadding">{{ $va -> name }}</div></span>
															</td>
															@if(($ke+1) % 5 == 0)
															</tr>
															<tr>
															@endif
														@endforeach
														
														</tr>
														</tbody>
														</table>
														@endif
													</td>
													@if(($k+1) % 5 == 0)
													</tr>
													<tr>
													@endif
												@endforeach
												</tr>
												</table>
												</div>
											</div>
									
											</td>
										</tr>
									</tbody>
								</table>
							</div>
							</td>
							<td class="margWidRight">
							</td>
						</tr>
					</tbody></table></td>
			</tr>
			<script>
			

			
			var cwy = document.getElementById("cw");
			cwy.onclick=clic;
			function clic()
			{
				var right = document.getElementsByClassName('right');
				var cityF=document.getElementById('cityF_popupDiv');
				cityF.style.visibility='visible';
				// 城市js
				var cip = document.getElementsByClassName('cityItemPadding');
				var city = document.getElementById("citywork");
				


				// var value=citywork.innerHTML;
				// console.log(city.value);
				// console.log(cip.length);
				var color = null;
				var scdj = city.value;
				// console.log(scdj);
				for(var item=0;item<cip.length;item++)
				{
					// console.log(cip[item].parentNode.id);
					if(scdj == '')
					{
						
					}else
					{
						if(scdj == cip[item].parentNode.id)
						{
							// console.log(530);
							cip[item].style.color='#ff6600';
						}
					}
					
					// cip[item].style.color='#3f419e';
					cip[item].onmouseover=function(){
						color=this.style.backgroundColor;
						this.style.background='#f09';
						// this.style.fontSize='18px';
					};
					cip[item].onmouseout=function(){
						
						this.style.background=color;
						// this.style.fontSize='18px';
					};
					
						if(cip[item].getAttribute('pid') && cip[item].parentNode.nextElementSibling)
						{
							
							// console.log(cityF_pConIcon);
							// console.log(cip[item].getAttribute('pid'));
							
							// console.log(cip[item].getAttribute('pid'));
							cip[item].onclick=function(){
								// this.onclick=CK;
								// var node = this.parentNode.parentNode.cloneNode(true);
								this.style.backgroundColor='#ffffff';
								var procity=document.getElementById('procity');
								var cityF_pCon=document.getElementById('cityF_pCon');
								var node = cityF_pCon.firstElementChild.cloneNode(true);
								
								// console.log(node);
								this.parentNode.nextElementSibling.style.display='block';
								cityF_pCon.replaceChild(this.parentNode.nextElementSibling,cityF_pCon.firstElementChild);
								// console.log(this.parentNode.nextElementSibling);
								procity.innerHTML = this.innerHTML+'[<span class="backtoProvinces substitute4a" id="back">返回其他省市</span>]';
								document.getElementById('back').onclick=function(e){
									cityF_pCon.replaceChild(node,cityF_pCon.firstElementChild);
									procity.innerHTML='省市';
									clic();
									e.stopPropagation();
								};
								// document.getElementById(scdj).style.color='#3f419e';
								// console.log(scdj);
								// var ci = document.getElementsByClassName('cityItemPadding');
								// for(var items=0;items<ci.length;items++)
								// {
								// 	ci[items].style.color='#3f419e';
								// 	// console.log(ci[items]);
								// }
								// cwy.value=this.innerHTML;
								// // this.style.background=color;
								// this.style.color='#ff6600';
								// // this.style.fontSize='18px';
								// // console.log(scdj);
								// scdj = this.parentNode.id;
								// city.value=this.parentNode.id;
								// cityF.style.visibility='hidden';
							};
						}else
						{
								cip[item].onclick=function(){
									// document.getElementById(scdj).style.color='#3f419e';
									// console.log(scdj);
									var ci = document.getElementsByClassName('cityItemPadding');
									for(var items=0;items<ci.length;items++)
									{
										ci[items].style.color='#3f419e';
										// console.log(ci[items]);
									}
									cwy.value=this.innerHTML;
									// this.style.background=color;
									this.style.color='#ff6600';
									// this.style.fontSize='18px';
									// console.log(scdj);
									scdj = this.parentNode.id;
									city.value=this.parentNode.id;
									cityF.style.visibility='hidden';
								};
						}
					
					
				}


				var hotcity = document.getElementsByClassName('hotcitysTitle');
				var cityF_hCon = document.getElementById('cityF_hCon');
				var cityF_hConIcon = document.getElementById('cityF_hConIcon');
				cityF_hCon.style.display='block';
				cityF_hConIcon.className='iconopen';
				hotcity[0].onclick=function(){
					if(cityF_hCon.style.display=='block')
					{
						cityF_hConIcon.className='iconclose';
						cityF_hCon.style.display='none';
					}else
					{
						cityF_hCon.style.display='block';
						cityF_hConIcon.className='iconopen';

					}
					
				}
				var prov = document.getElementsByClassName('provincesTitle');
				var cityF_pCon = document.getElementById('cityF_pCon');
				var cityF_pConIcon = document.getElementById('cityF_pConIcon');
				cityF_pCon.style.display='block';
				cityF_pConIcon.className='iconopen';
				cityF_pConIcon.onclick=function(){
					if(cityF_pCon.style.display=='block')
					{
						cityF_pConIcon.className='iconclose';
						cityF_pCon.style.display='none';
					}else
					{
						cityF_pCon.style.display='block';
						cityF_pConIcon.className='iconopen';

					}
					
				}
				right[0].onclick=function(){
					cityF.style.visibility='hidden';
				}
			}
			
			</script>
			<tr>
				<th valign="top" class="post_must">公司邮箱</th>
				<td>
					{{ session('master['.$id.']') -> email }}
				</td>
			</tr>
			<tr>
				<th valign="top" class="post_must">公司介绍</th>
				<td>
					<table>
						<tbody><tr>
							<td>
								<div>
									最多2000个字符<a></a>&nbsp;<font class="errorStr"></font>
								</div> <div class="form-group">
                                    <!-- 加载编辑器的容器 -->
                                    <script id="company" style='width:500px;height:150px;' name="companydetail" type="text/plain">{!! session('master['.$id.']') -> companydetail !!}</script>

                                    <!-- 实例化编辑器 -->
                                    <script type="text/javascript">
                                        var ue = UE.getEditor('company',{
                                        	maximumWords:2000,
                                        	toolbars: [
											    ['fullscreen', 'source', 'undo', 'redo'],
											    ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc','preview']
											],
    										autoHeightEnabled: false

                                        });

                                    </script>
                                   
                                </div>
						     <input type="hidden" value="" id="corpdesc">
							
							</td>
							<td valign="top" class="tieshi">
								<div style="margin-top: 7px" class="companyPersin">
									<span>提示：</span>您的公司介绍信息会出现在您的招聘广告页中，请您认真填写。<br>
									公司介绍包括但不限于以下几项：<br> 1、公司成立时间；<br> 2、公司主营业务；<br>
									3、公司目前规模。
								</div></td>
						</tr>
					</tbody></table></td>
			</tr>
			<tr>
				<th valign="top" class="post_must">招聘联系人</th>
				<td><input type="text"   value="{{ session('master['.$id.']') -> contactor }}" name="payuser" id="payuser" style='width:20%;float:left;' class="form-control input-sm">
				</td>
			</tr>
			<tr>
				<th valign="top" class="post_must">联系电话</th>
				<td>
					<input 
					@if(!empty(session('master['.$id.']') -> tel[0]))
						value='{{ session('master['.$id.']') -> tel[0] }}''
					@endif
					type="text"  placeholder="区号" maxlength="4" name="tel_1" id="tel1" style='width:10%;float:left;margin-right:10px' class="form-control input-sm">
					<input
					@if(!empty(session('master['.$id.']') -> tel[1]))
						value='{{ session('master['.$id.']') -> tel[1] }}''
					@endif
					type="text" style='width:15%;float:left;margin-right:10px' class="form-control input-sm" placeholder="固定电话" maxlength="8" name="tel_2" id="tel2" >
					<input
					@if(!empty(session('master['.$id.']') -> tel[2]))
						value='{{ session('master['.$id.']') -> tel[2] }}''
					@endif
					type="text" style='width:10%;float:left;' class="form-control input-sm" placeholder="分机号" maxlength="20" name="tel_3" id="tel3">
				</td>
			</tr>
			<tr>
				<th valign="top" class="post_must">联系人手机</th>
				<td><input type="text" style='width:25%;float:left;' class="form-control input-sm" value="{{ session('master['.$id.']') -> phone }}" name="userMobile" id="userMobile" placeholder="联系人手机">
				</td>
			</tr>
			<tr>
				<th valign="top" class="post_must">公司地址</th>
				<td><span id="adds2" style="width: 220px !important; padding: 0px !important;"> 
				<select id="add2" name="add2" class="ip_se2">
							<option value="">请选择</option>
						@foreach($mainData as $ke => $va)
						<option 
						@if(session('master['.$id.']') -> province == $va -> id)
							selected = 'true'
						@endif
						value="{{ $va -> id }}">{{ $va -> name }}</option>
						@endforeach
						@foreach($pidData as $k => $v)
						<option
						@if(session('master['.$id.']') -> province == $v -> id)
							selected = 'true'
						@endif
						value="{{ $v -> id }}">{{ $v -> name }}</option>
						@endforeach
					</select><span>省/直辖市</span> </span> 
					<span id="adds3" 
					@if(session('master['.$id.']') -> province == session('master['.$id.']') -> city)
					style="width: 210px ! important; padding: 0px ! important; display: none;"> 
					@else
					style="width: 210px ! important; padding: 0px ! important; display: ;"> 
					@endif
					<select id="add3" name="add3" class="ip_se3">
							<option value="">请选择</option>
							@foreach($idData as $key => $value)
							@foreach($value as $a => $re)
							<option
							@if(session('master['.$id.']') -> city == $re -> id)
								selected = 'true' style = 'display:block'
							@else
								style='display:none'
							@endif
							class='{{ $re -> pid }}' value="{{ $re -> id }}">{{ $re -> name }}</option>
							@endforeach
							@endforeach
					</select><span>市/区</span> </span><br> <input class="form-control input-sm" style="height:25px;width:40%" value="{{ session('master['.$id.']') -> address }}" name="corpAddrDetail" type="text">
				</td>
			</tr>
			<script>
			document.getElementById('add2').onchange=function()
			{
				var cla = this.options[this.selectedIndex].value;
				var item = document.getElementsByClassName(cla);
				var adds3 = document.getElementById('adds3');
				if(item.length)
				{
					adds3.style.display='';
					n=0;
					for(var i=0;i<document.getElementById('add3').options.length;i++)
					{
						if(cla == document.getElementById('add3').options[i].getAttribute('class'))
						{
							
							n++;
							document.getElementById('add3').options[i].style.display='';
							if(n==1)
							{
								document.getElementById('add3').options[i].setAttribute('selected','selected');
							}
							
						}else
						{
							document.getElementById('add3').options[i].style.display='none';
						}
					}
				}else
				{
					adds3.style.display='none';

				}
				
				// console.log(item);
				// var idData;
				// console.log(idData);
			}
			</script>
			<tr>
				<th valign="top" class="post_must">联系方式 <div id='moban' style='position:absolute;left:513px;top:945px;z-index:1400;background:#ccc;width:90px;height:25px'>从公司模板导入</div></th>
				<td class="o3class">
					<div style="position: absolute;left:150px ;top:1060px ; padding:10px;background: #ccf; width: 393px; visibility: hidden; z-index: 1099;" onclick="event.cancelBubble=true;" id="popupDiv_contactFromComp" class="popupDivCon">
						<div class="popupDivCon_Title">联系方式</div>
						<div class="popupDivCon_Content">
							<div style="margin-bottom: 5px;">
								<input type="checkbox" checked="checked" onfocus="this.blur()" value=""  id="comp_contact0"> <span id="text_comp_contact0">公司名称：</span> <input type="text" size="35" value="{{ session('master['.$id.']') -> compname }}" name="textInput_comp_contact0">
							</div>
							<div style="margin-bottom: 5px;">
								<input type="checkbox" checked="checked" onfocus="this.blur()" value=""  id="comp_contact1"> <span id="text_comp_contact1">公司地址：</span> <input type="text" size="35" style="background: #ffffff" value="" name="textInput_comp_contact1">
							</div>
							<div style="margin-bottom: 5px;">
								<input type="checkbox" onfocus="this.blur()" value=""  id="comp_contact2"> <span id="text_comp_contact2">联系电话：</span> <input type="text" size="35" value="--" style="background: #ffffff" name="textInput_comp_contact2">
							</div>
							<div style="margin-bottom: 5px;">
								<input type="checkbox" checked="checked" onfocus="this.blur()" value=""  id="comp_contact5"> <span id="text_comp_contact5">公司主页：</span> <input type="text" style="background: #ffffff" size="35" value="" name="textInput_comp_contact5">
							</div>
						</div>
						<div class="footer">
							<a class="confirm" href="javascript:void(0)">确定</a>
							<a class="cancle" href="javascript:void(0)">取消</a>
						</div>
					</div>
					<table>
						<tbody><tr>
							<td>
								<div id="anchorFromComp3">
									最多1000个字符<a ></a>&nbsp;<font class="errorStr"></font>
								</div> <div class="form-group">
                                    <!-- 加载编辑器的容器 -->
                                    <script id="lxfs" style='width:500px;height:150px;' name="lxfs" type="text/plain">{!! session('master['.$id.']') -> lxfs !!}</script>

                                    <!-- 实例化编辑器 -->
                                    <script type="text/javascript">
                                        var lxfs = UE.getEditor('lxfs',{
                                        	maximumWords:2000,
                                        	toolbars: [
											    ['fullscreen', 'source', 'undo', 'redo'],
											    ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc','preview']
											],
    										autoHeightEnabled: false
											
                                        });

                                    </script>
                                   
                                </div>
							</td>
							<td valign="top" class="tieshi">
								<div style="margin-top: 7px" class="companyPersin">
									<span>提示：</span>此处联系方式会展示在您的职位广告下方，让求职者会看到。请您准确填写。<br>
									联系方式包括：<br> 1 公司名称；<br> 2 公司地址；<br> 3 联系电话等。
								</div></td>
						</tr>
					</tbody></table></td>
			</tr>
			<!-- yingxu.fu start -->
				<tr>
					<td colspan='2'>
					<h2 style="font-weight: bolder; color: #114374;font-size:18px">&nbsp;企业认证</h2>
					<h3 style='font-size:14px'>&nbsp;认证状态：@if(session('master['.$id.']') -> authentication == 4 || session('master['.$id.']') -> authentication == 0)
                                    未认证 <a class="__ga__iHomepage_identity_001 ml20" href="modify.jsp" onclick="ZP.analysis.init_monitor_analy(this,'iHomepage','identity','001');;"></a>
                                    @elseif(session('master['.$id.']') -> authentication == 1)
                                    申请认证
                                    @elseif(session('master['.$id.']') -> authentication == 5)
                                    认证完成
                                    @endif
				@if(!empty(session('master['.$id.']') -> licenseImage))		
				<a href="{{ url('/home/enterprise/img') }}/{{ session('master['.$id.']') -> licenseImage }}" id='rzzl' target="_blank" style="font-size:12px;color: #114374;text-decoration:underline">查看认证资料</a>
				@endif	 	
			</h3></td>
				</tr>
				<tr><th class="post_must">营业执照<br> <font style="font-size: 11px;">(最新年检)</font>
				</th>
				<td><label> <input  type="radio" checked="checked" value="在线上传" name="busiLicense">在线上传 </label>
					 
					<div style="display: block;" id="onlineUpload">
						<div style="float: right; width: 310px" class="companyPersin">
							<span>提示：</span>请上传有最新年检章的营业执照；如果是复印件，需要加盖与执照公司名称一致的公司公章，以便您的营业执照顺利通过审核。<br>
							此处仅支持gif、jpg、png格式。大小不超过5M。
						</div>
						<input type="text" id="showText" class="ip_av1" > <input type="button" name='2' class="ip_upload"> <input type="file" class="fileInput" onchange="jQuery('#showText').val(this.value);" id="fileB" name="licenseImage[]">
					</div>  <br> <label><input type="radio" value="传真或电邮" name="busiLicense">
						把营业执照电子版发送到客服邮箱：zx@zhaopin.com.cn</label></td>
			</tr>
		</tbody></table>
		<script>
			function turncha()
			{
				// console.log($(this).attr('checked'));
				if(!$(this).attr('checked'))
				{
					// console.log($(this).val());
					// $(this).attr('checked','checked');
					$('#onlineUpload').fadeOut();
				}else
				{
					// console.log($(this).val());
					$('#onlineUpload').fadeIn();
					// $(this).attr('checked','');

				}
			}
			// 是否需要发票
			// console.log($('input[name=invoice]'));
			$('input[name=busiLicense]').each(function(i,v){
				// $(v[i]).click();
				$(v).change(turncha);
				// console.log($(v).val());
			})
			// $('input[name=invoice]').eq(1).change(cha);


			
		</script>
		<script>
				$('input[readonly]').css({
					'background-color':'#ffffff',
					'cursor':'pointer',
				});
			</script>
		<table width="100%" cellspacing="0" cellpadding="0">
			<!-- yingxu.fu end -->
			<tbody><tr>
				<td align="center" colspan="2">
					<input type="submit" class="ip_prebt" value='' >
				</td>
			</tr>
		</tbody></table>
		<!--信息填写 结束-->
		<!--职位描述过于简单时 弹出框-->
		<div style="display: none;" class="inforless">
			<iframe class="menu_iframe"></iframe>
			<div class="infor_closed">
				<input type="button" onclick="jQuery('.inforless').css('display','none');" class="close_" name="closed">
			</div>
			<h4>您的职位描述过于简单(少于50个字)</h4>
			<p>详尽的职位描述能够帮助求职者更好的了解职位的工作内容和要求，帮助您吸引更多目标求职者的关注，提升您的招聘效果。忽略请直接点击下一步！</p>
			<div class="infor_retu">
				<input type="button" onclick="javascript:jQuery('.inforless').css('display','none');" class="col1">
				<input type="button" onclick="javascript:submitForm('',1);" class="col2"> <input type="hidden" value="sv" id="btntype" name="ot">
			</div>
		</div>
	</form>
</div>
<script>
	// console.log();
	// return false;
	function check()
	{
		
		console.log(document.editCompanyInfo_form.input1.value.indexOf('请选择所属行业'));
		if(!document.editCompanyInfo_form.firstIndustry.value || document.editCompanyInfo_form.input1.value.indexOf('请选择所属行业') >= 0)
		{
			document.editCompanyInfo_form.input1.focus();
			alert('请选择所属行业');
			return false;
		}else if(!document.editCompanyInfo_form.industrylist.options.length)
		{	
			document.editCompanyInfo_form.industry.focus();
			alert('请选择次所属行业');
			return false;
		}else if(!document.editCompanyInfo_form.corptype.selectedIndex)
		{	
			document.editCompanyInfo_form.corptype.focus();
			alert('请选择公司性质');
			return false;
		}else if(!document.editCompanyInfo_form.corpsize.selectedIndex)
		{	
			document.editCompanyInfo_form.corpsize.focus();
			alert('请选择公司规模');
			return false;
		}else if(!document.editCompanyInfo_form.citywork.value)
		{
			document.editCompanyInfo_form.cw.focus();
			alert('请选择工作地点');
			return false;
		}else if(!document.editCompanyInfo_form.payuser.value)
		{
			document.editCompanyInfo_form.companydetail.focus();
			alert('请输入招聘联系人');
			return false;
		}else if(!document.editCompanyInfo_form.tel_2.value && !document.editCompanyInfo_form.userMobile.value)
		{
			document.editCompanyInfo_form.userMobile.focus();
			alert('请输入联系人手机或电话');
			return false;
		}else if(!document.editCompanyInfo_form.add2.selectedIndex)
		{	
			document.editCompanyInfo_form.add2.focus();
			alert('请选择所在省市直辖市');
			return false;
		}else if(!document.editCompanyInfo_form.corpAddrDetail.value)
		{
			document.editCompanyInfo_form.corpAddrDetail.focus();
			alert('请输入详细的公司地址');
			return false;
		}else if(document.getElementById('onlineUpload').style.display == 'block' && !document.getElementById('showText').value)
		{
			document.getElementById('onlineUpload').focus();
			alert('请输入公司营业执照');
			return false;
		}

		for (var i =0; i < document.getElementById('industrylist').options.length; i++) {
			document.getElementById('industrylist').options[i].focus();
			document.getElementById('industrylist').options[i].selected=true;
		};
		// console.log(document.getElementById('industrylist').options.length);
		// alert();
		// return false;

		// document.getElementById('industrylist').options
		// return false;
	}

</script>
@endsection